#!/bin/bash

# test non-compressed ( with -c option )
rm simple-parser.c simple-parser.out simple-parser.h
./lemon -c -T../template/lempar.c simple-parser.y

diff -u simple-parser.c-no-compress simple-parser.c
diff -u simple-parser.out-no-compress simple-parser.out
diff -u simple-parser.h-no-compress simple-parser.h

# test basis report
rm simple-parser.c simple-parser.out simple-parser.h
./lemon -b -T../template/lempar.c simple-parser.y

diff -u simple-parser.cb simple-parser.c
diff -u simple-parser.out-basis simple-parser.out
diff -u simple-parser.hb simple-parser.h

# test compressed
rm simple-parser.c simple-parser.out simple-parser.h
./lemon -T../template/lempar.c simple-parser.y

diff -u simple-parser.cb simple-parser.c
diff -u simple-parser.outb simple-parser.out
diff -u simple-parser.hb simple-parser.h
echo "if there are no diff output above, test ok"
